package 小易打怪升级;

import java.util.Scanner;

/**
 * Created by hest0 on 2017/4/17.
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int init = sc.nextInt();
            int[] b = new int[n];
            for (int i = 0; i < n; i++) {
                b[i] = sc.nextInt();
            }
            System.out.println(func(n, init, b));
        }
        sc.close();
    }

    private static int func(int n, int init, int[] b) {
        int c = init;
        for (int i = 0; i < n; i++) {
            c += c >= b[i] ? b[i] : gcd(b[i], c);
        }
        return c;
    }

    private static int gcd(int m, int n) {
        return n == 0 ? m : gcd(n, m % n);
    }
}
